﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chinaer.IDao;
using Chinaer.Dao.EF;
using Chinaer.Model;

namespace Chinaer.Dao
{
    public class AdministratorDAO : IAdministratorDAO
    {
        IDao.IAdministratorDAO administratorDAO = new EF.AdministratorLoginDAO();

        public bool Add(Model.Entities.Model_Administrator administrator)
        {
            return administratorDAO.Add(administrator);
        }

        public bool EnableTrack
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }


        public IList<Model.Entities.Model_Administrator> Query(string sql, int pageIndex, out int recordCount, int pageSize, params System.Data.SqlClient.SqlParameter[] sqlParams)
        {
            return administratorDAO.Query(sql, pageIndex, out recordCount, pageSize, sqlParams);
        }

        public Model.Entities.Model_Administrator GetByID(string id)
        {
            return administratorDAO.GetByID(id);
        }

        public bool Exists(string id)
        {
            return administratorDAO.Exists(id);
        }

        public bool Update(Model.Entities.Model_Administrator entity)
        {
            return administratorDAO.Update(entity);
        }

        public bool Delete(Model.Entities.Model_Administrator entity)
        {
            return administratorDAO.Delete(entity);
        }

        public bool Delete(string id)
        {
            return administratorDAO.Delete(id);
        }

        public int DeleteByIDs(IList<string> listID)
        {
            return administratorDAO.DeleteByIDs(listID);
        }

        public Model.Entities.Model_Administrator GetByName(string name)
        {
            return administratorDAO.GetByName(name);
        }


        public Model.Entities.Model_Administrator GetByNameAndPassword(string name, string password)
        {
            return administratorDAO.GetByNameAndPassword(name, password);
        }


        public List<Model.Entities.Model_Administrator> GetAllAdministrators()
        {
            return administratorDAO.GetAllAdministrators();
        }
    }
}
